package com.mbyte.easy.admin.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author driver-design
 * @description
 * @date 2022/4/3
 */
public enum DimensionEnums {

    CHINESE("chinese", "语文"),
    MATH("math", "数学"),
    ENGLISH("english", "英语"),
    WEN_SUM("wen_sum", "文综"),
    LI_SUM("li_sum", "理综"),
    SCORE_SUM("score_sum", "总分"),
    GRADE_RANK("grade_rank", "班排名"),
    SCHOOL_RANK("school_rank", "校排名");

    private String code;

    private String desc;

    DimensionEnums(String code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static DimensionEnums of(String code){
        if (StringUtils.isNotEmpty(code)) {
            for (DimensionEnums dimensionEnums : DimensionEnums.values()) {
                if (code.equals(dimensionEnums.getCode())) {
                    return dimensionEnums;
                }
            }
        }

        return null;
    }



}
